<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="${pageContext.request.contextPath }/bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="${pageContext.request.contextPath }/bootstrap/css/bootstrap-overrides.css" type="text/css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/bootstrap/css/compiled/layout.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/bootstrap/css/compiled/elements.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/bootstrap/css/compiled/icons.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/bootstrap/css/lib/font-awesome.css">
<link rel="stylesheet" href="${pageContext.request.contextPath }/bootstrap/css/compiled/signin.css" type="text/css" media="screen" />
<link rel="stylesheet" href="${pageContext.request.contextPath }/bootstrap/css/bundled.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/bootstrap/css/jquery-confirm.css"/>
<title>后台登陆</title>
</head>
<body>
    <div class="login-wrapper">
        <%-- <a href="#">
            <img class="logo" src="${pageContext.request.contextPath }/bootstrap/img/logo-white.png">
        </a> --%>
        <h1>速递医运后台管理</h1>
        <div class="box">
            <div class="content-wrap">
	        	<h6>登录</h6>
	        	<input class="form-control" id="adminloginname" type="text" placeholder="用户名（注册手机或邮箱）">
	            <input class="form-control" id="adminloginpwd" type="password" placeholder="密码">
	            <a href="#" class="forgot">忘记密码?</a>
	            <div class="remember">
	                <input id="remember-me" type="checkbox">
	                <label for="remember-me">记住密码</label>
	           </div>
	           <button class="btn-glow primary login" type="button" id="LoginBtn" onclick="Login();">
	           	<span class="bigger-110"> 登录</span>
	           </button>
            </div>
        </div>
        <div class="no-account">
            <p>还没账号?</p>
            <a href="#">注册</a>
        </div>
    </div>
    <script src="${pageContext.request.contextPath }/bootstrap/js/bundled.js"></script>
    <script src="${pageContext.request.contextPath }/bootstrap/js/jquery-confirm.js"></script>
    <script src="${pageContext.request.contextPath }/bootstrap/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath }/bootstrap/js/theme.js"></script>
    <script type="text/javascript">$("html").css("background-image", "url('${pageContext.request.contextPath }/bootstrap/img/bgs/9.jpg')");</script>
	<script type="text/javascript">
		function Login(){
			var AdminLoginName=$('#adminloginname').val();
			var AdminLoginPwd=$('#adminloginpwd').val();
			//alert(AdminLoginName+":"+AdminLoginPwd);
			if(AdminLoginName=="" || AdminLoginPwd==""){
				$.alert("用户名密码不可为空！！");
				return false;
			}
			$("#LoginBtn").html('<span class="bigger-110"> 登录中...</span>');
			$('#LoginBtn').prop('disabled',true);
			$.ajax({
				type:"post",
				url:"${pageContext.request.contextPath}/Login/loginSubmit.action",
				//contentType:"application/json;charset=utf-8",
				data:"adminloginname="+AdminLoginName+"&adminloginpwd="+AdminLoginPwd,
				success:function(data){
					if(data.code==100){
						window.location.href="${pageContext.request.contextPath}/Main/mainpage.aciton";
					}else{
						$.alert(data.msg);
						$("#LoginBtn").html('<span class="bigger-110"> 登录</span>');
						$('#LoginBtn').prop('disabled',false);
					}
				},
				error:function(data){
					$.alert("数据连接错误！");
					$("#LoginBtn").html('<span class="bigger-110"> 登录</span>');
					$('#LoginBtn').prop('disabled',false);
				}
			})
		}
	</script>
</body>
</html>